Make echo-keystrokes a variable and speed it up.
authorjustbur <justin@burkett.cc>
Tue, 7 Jul 2015 19:11:46 +0000 (15:11 -0400)
committerjustbur <justin@burkett.cc>
Tue, 7 Jul 2015 19:19:06 +0000 (15:19 -0400)
which-key.el

index 1d2c7586ca8de3fe4009d1b3d9e7fb2fbd1cec22..8c4317e25a03e92acb5a4b7ee60e87b67fdae25d 100644 (file)
   "Delay (in seconds) for which-key buffer to popup.")
 ;; (defvar which-key-close-buffer-idle-delay 4
 ;;   "Delay (in seconds) after which buffer is forced closed.")
+(defvar which-key-echo-keystrokes
+  (min echo-keystrokes (/ (float which-key-idle-delay) 4))
+  "Value to use for echo-keystrokes. This only applies when
+`which-key-popup-type' is minibuffer. It needs to be less than
+`which-key-idle-delay' or else the echo will erase the which-key
+popup.")
 (defvar which-key-max-description-length 27
   "Truncate the description of keys to this length.  Also adds
 \"..\".")
@@ -107,12 +113,11 @@ Used when `which-key-popup-type' is frame.")
   (if which-key-mode
       (progn
         (unless which-key--setup-p (which-key/setup))
-        ;; reduce echo-keytrokes for minibuffer popup
+        ;; reduce echo-keystrokes for minibuffer popup
         ;; (it can interfer if it's too slow)
         (when (and (> echo-keystrokes 0)
                    (eq which-key-popup-type 'minibuffer))
-          (setq echo-keystrokes
-                (min echo-keystrokes (/ (float which-key-idle-delay) 2)))
+          (setq echo-keystrokes which-key-echo-keystrokes)
           (message "Which-key-mode enabled (note echo-keystrokes changed from %s to %s)"
                    which-key--echo-keystrokes-backup echo-keystrokes))
         (add-hook 'pre-command-hook #'which-key/hide-popup)